README.txt
----------------------------------------------------------------------------------------------------- 
This zip file contains the computational codes for “Education in a Heterogenous-Agent Economy: Revisiting Transatlantic Differences” by Orhan Torul.

Please first unzip all files/folders inside the main folder. 

The benchmark code (in the benchmark_codes folder) is written as a Fortran 90 (.f90) standalone code, which uses 

1)forprob.txt
2)forzeta.txt

text files in value function iteration, and are need to be placed in the same folder as the Fortran 90 code to compile. These two text files are generated by tauchen.m MATLAB script, which approximates the AR(1) processes of the inborn competence (zeta) shock. (The tauchen.m file can be found under the auxilary_matlab_codes folder) The text files (in zip form) can be found in the zip_files_for_fortran folder. 

In addition, throughout the simulations, the Fortran 90 benchmark code needs to read the

3)shockzeta.txt

text file, which is a generated random number matrix of number of individuals in the economy (1000) times number of periods (11000).  This file (in zip form) can also be found in the zip_files_for_fortran folder. 


The benchmark code has the following parameter and preliminary values:

lambda   	=  0.625; % share of human capital in production function
mu       	=  0.375; % share of labor in production function
Theta    	=  5.0  ; % production coefficient (when there is)
gamma    	=  0.20 ; % power in the law of motion for human capital
rho      	=  0.80 ; % discount rate for the offspring's utility 
l        	=  0.33 ; % fixed labor supply (in fixed-labor specification)
epsilon 	=  0.30 ; % power in the law of motion for human capital
nu	 	=  0.50 ; % public education spillover parameter 	

nzeta	        =    25;  % number of grid points for inborn competence   

hmin    	=  0.01;  % minimum possible human capital level
hmax    	=   5.0;  % maximum possible human capital level
nh	        =   500;  % number of grid points for human capital

privateedumin 	=   0.0;  % minimum possible private education choice (0=public education)
privateedumin 	=   2.0;  % maximum possible private education choice
nprivateedu   	=   200;  % number of grid points for private education choice

Tax rates are exogenous discrete inputs to the model (e.g. 0%, 0.5%, ... , 15%.) 

To compile the model economies, place 1), 2) and 3) in the same folder as the .f90 standalone code.

To generate the comparative statics results, change the above parameter values in the fortran code (to the targets in the manuscript) and compile. 

The benchmark code assumes for fixed constant labor supply (i.e. l=0.33). As the name implies, the endogenous labor specification in the manuscript relaxes this assumption and endogenizes the labor supply decision. Accordingly, the solution algorithm requires an additional labor supply choice, and the corresponding Fortran 90 .f90 standalone code can be found in the endogenous_labor_codes folder. The additional parameters (on utility function) are as follows:

u(c)+ v(1-l)= log(c)- phi * labor^{1+\omicron}/ {1+\omicron}

phi   	        =  2.138; % disutility coefficient of labor, calibrated so that labor=0.33 in the laissez-faire economy (with zero taxes) labor supply equals labor=0.33 as in the fixed-labor model
omicron       	=   0.5;  % so that Frisch elasticity equals 2

labormin    	=  0.25;  % minimum possible labor supply level
labormax    	=  0.35;  % maximum possible labor supply level
nlabor	        =    40;  % number of grid points for labor supply

While compiling the endogenous labor supply code, I reduce the number of grid points for human capital and education in order to economize on running time and document size efficiency. 

As before, to compile the model economies, please place 1), 2) and 3) in the same folder as the .f90 standalone endogenous labor supply code.

The Fortran 90 standalone code generates several auxiliary text documents to be used for several (e.g. calculating the Lorenz curve and the gini coefficients, stationary distributions over human capital and inborn competence points, ... ) For these purposes, I place some of the auxiliary MATLAB codes in the auxilary_matlab_codes folder, which are to be placed in the relevant folders as the outputs of the .f90 standalone code, and adjusted as necessary per purpose. (I refrain from placing them and the generated auxiliary text files because of their very bulky size (in gigabytes) in total.)

For the fit of the model with the data, you can find the match.wf1 EViews file under the eviews_codes folder. Further, the figures generated by EViews can be found in the figure_preparation.wf1 file under the same folder, too. 


In order to generate the stationary distribution of individuals over inborn productivity and individual human capital pairs, please refer to the stationary_distribution folder. The folder contains two subfolders to exemplify the stationary distributions for the calibrated American and Nordic economies. In each folder, there are 1)prob.mat 2)zeta.mat documents, which are generated by the Tauchen code. In addition, in each of the sub-folders, there is a 3)yerhuggett.txt text file, which contains the decision rules (for the respective economy as a result of tax regime) resulting from value function iterations. Once the stationary_distribution_usa.m or stationary_distribution_nordic.m files are compiled, stationary distributions are illustrated. The two folders also contain decisionrule_usa.m and decisionrule_nordic.m MATLAB scripts, which generate decision rules of the two economic via decision rules from the yerhuggett.txt text file. The codes to generate education decision rules under the 0% and the 15% tax regimes can be found under the decision_rule folder. decisionrule_t0.m and decisionrule_t15.m MATLAB scripts load zeta.mat and yerhuggett.txt files, which are the inborn competence and decision rule files, respectively. As a result, the two scripts generate the decision rule figures as in the manuscript. 

Using the variants (with proper tax, human capital and public education inputs) of the stationary_distribution codes,  I calculate the stationary distributions by the use for each tax regime, and save the distributions with the names mu0.txt , mu0_5.txt , mu0_5.txt ... in theconsumption_equivalent_gains folder, along with education decision rules (yerhuggett0.txt , yerhuggett0_5.txt , yerhuggett1.txt ...)  and value functions (vhuggett0.txt , vhuggett0_5.txt , vhuggett1.txt ...) which are generated by the value function iteration in the Fortran 90 .f90 codes. Combining these outputs, huggettstandardforvalue.m MATLAB script first generates average lifetime welfare under different tax regimes. Next, it calculates consumption-equivalent welfare gains over taxes (relative to the laissez-faire tax (tau=0) regime). It generates the consumption-equivalent-gain figures as outputs. Although the folder is bulky in size, I keep the necessary input files in the folder so that huggettstandardforvalue.m is readily available for compilation, since the generation of the education decision rules, value functions and stationary distributions for each tax regime is quite time consuming.    

The fiscal robustness folder includes two subfolders: 1) redistribution & 2) progressive_taxation. These two folders contain the robustness experiment (Fortran 90) codes of the model with rebates and progressive income taxation. 

For the inequality calculations, I use the lorenz.m and ginicoeff.m MATLAB codes once I generate the relevant individual-level output after simulations (via Fortran 90 codes). These MATLAB scripts can be found in the auxilary_matlab_codes folder. 


Please feel free to send me an e-mail at orhan.torul@boun.edu.tr for your inquiries. 
--
January 2020, Istanbul. 

Orhan Torul
Assistant Professor
Department of Economics
Boğaziçi University
34342, Bebek, Istanbul, Turkey
Tel: (+90) 212 359 6677
Fax: (+90) 212 287 2453
E-mail: orhan.torul@boun.edu.tr
Web:  http://www.orhantorul.com


